package cn.net.Reflection;
/*
学生类：普通属性+普通方法+toString方法（==）
 */
public class Student {
  public   String name;//默认私有，添加public
 public    int age;
 //有参和无参构造
    public Student() {
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }
    //有参和无参的成员方法
    public void eat(){
        System.out.println("开饭了");
    }
    public void play(int n){
        System.out.println("我今天玩了"+n+"个小时代码");

    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
